import { createApp } from 'vue'
import './style.css'
import App from './App.vue'

//引入pinia
import { createPinia } from "pinia";
import piniaPluginPersist from 'pinia-plugin-persist'
const pinia = createPinia()
pinia.use(piniaPluginPersist)
//引入element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 注册element-plus图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//引入路由
import router from './router'
import { permission } from './directives/permission'

const app = createApp(App)
app.directive('permission', permission)
// 注册element-plus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(pinia)
app.use(ElementPlus)//使用element-plus
app.use(router)


app.mount('#app')